package com.xfcy.blog.controller.system;



import cn.dev33.satoken.annotation.SaCheckLogin;
import cn.dev33.satoken.annotation.SaCheckPermission;
import com.xfcy.blog.annotation.OperationLogger;
import com.xfcy.blog.common.R;
import com.xfcy.blog.service.UserLogService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;
import java.util.List;

/**
 * 日志表(UserLog)表控制层
 *
 * @author 晓风残月Lx
 * @since 2023-04-09 11:03:06
 */
@RestController
@RequestMapping("system/userLog")
@Api(tags = "用户日志管理")
public class UserLogController {

    @Resource
    private UserLogService userLogService;

    @GetMapping("/list")
    @ApiOperation(value = "用户日志列表", httpMethod = "GET", response = R.class, notes = "用户日志列表")
    @SaCheckLogin
    public R list(Integer pageNo, Integer pageSize) {
        return userLogService.listUserLog(pageNo, pageSize);
    }

    @OperationLogger(value = "用户日志删除")
    @DeleteMapping("/delete")
    @ApiOperation(value = "用户日志删除", httpMethod = "DELETE", response = R.class, notes = "用户日志删除")
    @SaCheckPermission("/system/userLog/delete")
    public R delete(@RequestBody List<Long> ids) {
        return userLogService.delete(ids);
    }


}

